import http from "@/utils/request";
// 请求数据
export const getData = () => {
  // 返回一个promise对象
  return http.get('prod-api/api/job/company/list')
}
// 注册
export const reg = (param) => {
  // 返回一个promise对象
  return http.post('api/reg', param)
}
// 登录
export const Login = (param) => {
  return http.post('api/login', param)
}
// 修改个人信息
export const updateUser = (param) => {
  return http.post('updateUser', param)
}

// 个人用户信息
export const showuser = () => {
  return http.get('showuser')
}
// 管理员信息
export const getAdmin = () => {
  return http.get('showAdmin')
}
// 用户信息
export const getUser = () => {
  return http.get('showInfo')
}
// 角色
export const getRoleList = () => {
  return http.get('showRoleList')
}
// 查看说明
export const getExplain = () => {
  return http.get('api/Explain')
}
//查看商品类别
export const getType = () => {
  return http.get('api/Type')
}
//查看商品
export const getproduct = () => {
  return http.get('api/Product')
}
//查看商品分页
export const showPageProduct = (param) => {
  return http.get(`showPageProduct?pageNum=${param.pageNum}&pageSize=${param.pageSize}`)
}
// 分页展示个人订单
export const showPageOrderGe = (param) => {
  return http.get(`showPageOrderGe?pageNum=${param.pageNum}&pageSize=${param.pageSize}`)
}
//查看商品加规格
export const getproductSpecs = () => {
  return http.get('api/showProductSpecs')
}
//查看所有商品信息
export const showProductAll = (param) => {
  return http.get(`api/showProductAll?product_id=${param}`)
}

// 商品添加
export const Product = (param) => {
  // 返回一个promise对象
  return http.post('addProduct', param)
}
// 修改商品
export const updateProduct = (param) => {
  // 返回一个promise对象
  return http.post('updateProduct', param)
}

// 添加类别
export const addType = (param) => {
  // 返回一个promise对象
  return http.post('addType', param)
}
// 添加商品说明
export const addExplain = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('addExplain', param)
}
// 删除说明
export const deletsExplain = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('deletsExplain', param)
}

//查看商品说明
// export const Explain = () => {
//   return http.get('api/Explain')
// }
// 删除规格
export const deletsSpecs = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('deletsSpecs', param)
}
//查看商品规格
export const getSpecs = () => {
  return http.get('api/Specs')
}
// 添加规格
export const addSpecs = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('addSpecs', param)
}



// 删除类别
export const deletsType = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('deletsType', param)
}

// 删除商品
export const deletsProduct = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('deletsProduct', param)
}


// 添加轮播图
export const addBanner = (param) => {
  // 返回一个promise对象
  return http.post('addBanner', param)
}
// 查看轮播图
export const getBanner = () => {
  return http.get('api/Banner')
}
// 删除轮播图
export const deletsBanner = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('deletsBanner', param)
}
// 更新轮播图
export const updataBanner = (param) => {
  // console.log(param);
  // 返回一个promise对象
  return http.post('updataBanner', param)
}
// 轮播图分页(后台)
export const showPageBanner = (param) => {
  return http.get(`api/showPageBanner?pageNum=${param.pageNum}&pageSize=${param.pageSize}`)
}

// 评价
export const showProductReview = (param) => {
  return http.get(`api/showProductReview?product_id=${param}`)
}

// 添加商品评价
export const AddProductReview = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('AddProductReview', param)
}
// 查看购物车
export const showShopcart = () => {
  return http.get(`showShopcart`)
}
// 添加购物车
export const addShoppingCart = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('addShoppingCart', param)
}
// 修改购物车
export const updateCart = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('updateCart', param)
}
// 删除购物车
export const delShopCart = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('delShopCart', param)
}
// 清空购物车
export const clearCart = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('clearCart', param)
}
// 添加订单
export const AddOrder = (param) => {
  // 返回一个promise对象
  return http.post('AddOrder', param)
}
// 查看订单
export const showOrders = () => {
  return http.get('showOrders')
}

// 查看 所有订单
export const OrdersAll = () => {
  return http.get('OrdersAll')
}
// 订单分页
export const showPageOrders = (param) => {
  return http.get(`api/showPageOrders?pageNum=${param.pageNum}&pageSize=${param.pageSize}`)
}
// 查看退货原因
export const showReturn = () => {
  return http.get('showReturn')
}
// 修改退货原因
export const updataReturn = (param) => {
  console.log(param);
  // 返回一个promise对象
  return http.post('updataReturn', param)
}
// 查看收藏
export const showProductCollect = (param) => {
  return http.get(`showProductCollect?product_id=${param}`)
}

// 查看个人收藏
export const showCollect = () => {
  return http.get('showCollect')
}
// 添加收藏
export const AddCollect = (param) => {
  // 返回一个promise对象
  return http.post('AddCollect', param)
}
// 删除收藏
export const deletsCollect = (param) => {
  // 返回一个promise对象
  return http.post(`deletsCollect?collect_id=${ param}`)
}